﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MVVM.Core;

namespace ObjectModel.Excel
{
    /// <summary>
    /// Defines a relationship between a range and a value whose
    /// resolution can be delayed until required.
    /// </summary>
    public class ValueCondition : NotificationBase
    {
        private OfflineSourceRange mRange;
        private string mValue;
        
        public OfflineSourceRange ConditionalRange
        {
            get { return mRange; }
            set
            {
                mRange = value;
                OnPropertyChanged("ConditionalRange");
            }
        }

        public string ConditionalValue
        {
            get { return mValue; }
            set
            {
                mValue = value;
                OnPropertyChanged("ConditionalValue");
            }
        }

        public void Resolve()
        {
            ConditionalRange.Range.Value = ConditionalValue;
        }
    }
}
